<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    //JS中判断数组的方法
    /*
      1.通过 Object.prototype.toString.call()
      2.通过原型链判断
      3.isArray
      4.instanceof 判断

    */
    //   1.通过 Object.prototype.toString.call()
    let arr = []
    console.log(Object.prototype.toString.call(arr).slice(8, -1) === 'Array');
    // 2.通过原型链判断
    //对象的隐式原型等于构造函数的显示原型
    console.log([].__proto__ === Array.prototype);
    // 3.isArray
    console.log(Array.isArray([]));
    // 4.instanceof 判断
    console.log([] instanceof Array);
    // 5.通过Array.prototype.isPrototypeOf
    // console.log(Array.prototype.isPrototype0f([]));
  </script>
</body>

</html>